package com.taotao.service.impl;

import com.taotao.TaotaoResult;
import com.taotao.mapper.TbItemMapper;
import com.taotao.pojo.TbItem;
import com.taotao.service.TbItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author evader
 * @date 2020-10-09 13:43
 */
@Service
public class TbItemServiceImpl implements TbItemService {

    @Autowired
    private TbItemMapper tbItemMapper;

    @Override
    public TaotaoResult getItemDetails(Long id) {
        try {
            TbItem tbItem = tbItemMapper.selectByPrimaryKey(id);
            return TaotaoResult.ok(tbItem);
        } catch (Exception e) {
            e.printStackTrace();
            return new TaotaoResult();
//            return TaotaoResult.error("查询商品详情出错", ExceptionUtil.getStackTrace(e));
        }
    }
}

